<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditStudentsTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditStudentsLabel_id}" for="id" />
                    <h:inputText id="id" value="#{studentsController.selected.id}" title="#{bundle.EditStudentsTitle_id}" required="true" requiredMessage="#{bundle.EditStudentsRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditStudentsLabel_enRoll}" for="enRoll" />
                    <h:inputText id="enRoll" value="#{studentsController.selected.enRoll}" title="#{bundle.EditStudentsTitle_enRoll}" />
                    <h:outputLabel value="#{bundle.EditStudentsLabel_stuName}" for="stuName" />
                    <h:inputText id="stuName" value="#{studentsController.selected.stuName}" title="#{bundle.EditStudentsTitle_stuName}" />
                    <h:outputLabel value="#{bundle.EditStudentsLabel_stuPhone}" for="stuPhone" />
                    <h:inputText id="stuPhone" value="#{studentsController.selected.stuPhone}" title="#{bundle.EditStudentsTitle_stuPhone}" />
                    <h:outputLabel value="#{bundle.EditStudentsLabel_stuAddress}" for="stuAddress" />
                    <h:inputText id="stuAddress" value="#{studentsController.selected.stuAddress}" title="#{bundle.EditStudentsTitle_stuAddress}" />
                    <h:outputLabel value="#{bundle.EditStudentsLabel_stuEmail}" for="stuEmail" />
                    <h:inputText id="stuEmail" value="#{studentsController.selected.stuEmail}" title="#{bundle.EditStudentsTitle_stuEmail}" />
                    <h:outputLabel value="#{bundle.EditStudentsLabel_status}" for="status" />
                    <h:inputText id="status" value="#{studentsController.selected.status}" title="#{bundle.EditStudentsTitle_status}" />
                    <h:outputLabel value="#{bundle.EditStudentsLabel_courseId}" for="courseId" />
                    <h:selectOneMenu id="courseId" value="#{studentsController.selected.courseId}" title="#{bundle.EditStudentsTitle_courseId}" >
                        <f:selectItems value="#{coursesController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{studentsController.update}" value="#{bundle.EditStudentsSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditStudentsViewLink}"/>
                <br />
                <h:commandLink action="#{studentsController.prepareList}" value="#{bundle.EditStudentsShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditStudentsIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
